package router

import (
	"api-gateway/basic/consts"
	"api-gateway/handler/api"
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {

	routerGroup := r.Group("v1")
	{
		apiUser := routerGroup.Group("api")
		{
			apiUser.POST("login", api.Login)

		}
		apiVdieo := routerGroup.Group("api")
		{
			apiVdieo.Use(jwt.JWTAuth(consts.KEY_SEVRET_JWT))
			apiVdieo.POST("videoPub", api.VideoPub)
			apiVdieo.POST("shortPub", api.ShortPub)
			apiVdieo.POST("shortList", api.ShortList)
			apiVdieo.POST("shortInfo", api.ShortInfo)
			apiVdieo.POST("shortStatus", api.ShortStatus)
			apiVdieo.POST("shortDel", api.ShortDel)

		}
	}

}
